package com.example.proxy.client;

import com.example.proxy.service.OrderService;
import com.example.proxy.service.impl.OrderServiceImpl;
import com.example.proxy.service.impl.OrderServiceImplSub;
import com.example.proxy.service.impl.OrderServiceProxy;

/**
 * ClassName:Test
 * Package:com.example.proxy.client
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/10-14:40
 * @Version:v1.0
 */
public class Test {
    public static void main(String[] args) {
//        OrderService orderService = new OrderServiceImpl();
//        orderService.generate();
//        orderService.modify();
//        orderService.detail();


//        OrderService orderService = new OrderServiceImplSub();
//        orderService.generate();
//        orderService.modify();
//        orderService.detail();

        //创建目标对象
        OrderService target = new OrderServiceImpl();
        //创建代理对象
        OrderServiceProxy proxy = new OrderServiceProxy(target);
        //调用代理对象的代理方法
        proxy.generate();
        proxy.modify();
        proxy.detail();
    }
}
